package com.example.myapplication;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

public class Activity_UC1 extends AppCompatActivity implements View.OnClickListener{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity__uc1);


        findViewById(R.id.btn_ReturnMain).setOnClickListener(this);
        findViewById(R.id.btn_UC1_Horizontal).setOnClickListener(this);
        findViewById(R.id.btn_UC1_Vertical).setOnClickListener(this);
        findViewById(R.id.btn_UC1_AlignLeft).setOnClickListener(this);
    }

    public void onClick(View v){

        Intent intent=new Intent();

        LinearLayout LL_UC1=findViewById(R.id.ll_UC1Main);
        Button btn_UC1_First=findViewById(R.id.btn_UC1_Horizontal);

        switch (v.getId()){
            case R.id.btn_ReturnMain:
                intent.setClass(this,MainActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_UC1_Horizontal:
                LL_UC1.setOrientation(LinearLayout.HORIZONTAL);
                LL_UC1.setGravity(Gravity.CENTER);
                break;
            case R.id.btn_UC1_Vertical:
                LL_UC1.setOrientation(LinearLayout.VERTICAL);
                LL_UC1.setGravity(Gravity.CENTER);
                break;
            case R.id.btn_UC1_AlignLeft:
                LL_UC1.setOrientation(LinearLayout.VERTICAL);
                LL_UC1.setGravity(Gravity.CENTER_VERTICAL);
                break;
        }
    }
}
